//
//  LS_CustomTabBarController.h
//  breadPro
//
//  Created by 刘文超 on 2019/7/3.
//  Copyright © 2019 刘文超. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXTERN NSString *const LS_TabBarItemTitle;
FOUNDATION_EXTERN NSString *const LS_TabBarItemImage;
FOUNDATION_EXTERN NSString *const LS_TabBarItemSelectImage;

FOUNDATION_EXTERN NSUInteger LS_CustomButtonIndex;
FOUNDATION_EXTERN CGFloat LS_TabbarItemWidth;
FOUNDATION_EXTERN NSUInteger LS_TabbarItemsCount;
FOUNDATION_EXTERN NSString *const LS_TabBarItemWidthDidChangeNotification;
@interface LS_CustomTabBarController : UITabBarController

/**
 显示在tabbar 上面的字控制器数
 */
@property(nonatomic,readwrite,strong)NSArray<UIViewController *> *tabBarViewControllers;

/**
 tabbaritem的属性数组
 */
@property(nonatomic,readwrite,strong)NSArray<NSDictionary *> *tabBarItemsAttribute;

/**
 自定义tabbar的高度
 */
@property(nonatomic,assign)CGFloat tabBarHeight;

/**
 设置tabbar中图片的位置 默认是uiedgeInsetZero
 */
@property(nonatomic,readwrite,assign)UIEdgeInsets imageInsets;

/**
 设置tabbar文字的位置 
 */
@property(nonatomic,readwrite,assign)UIOffset  titlePositionAdjustment;


/*!
 *  是否加了中间的按钮
 */
+ (BOOL)haveCustomButton;


/*!
 *  返回当前根窗口
 *
 */
- (UIWindow *)rootWindow;


/**
  初始化tabbarcontroller
 */
-(instancetype)initWithViewControllers:(NSArray<UIViewController *> *)viewControllers tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes;

/**
  类方法快速创建
 */
+(instancetype)tabBarControllerWithViewControllers:(NSArray<UIViewController *> *)viewControllers tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes;

@end










@interface NSObject (LS_CustomTabBarController)

/**
 如果self为uiviewcontrol的时候，返回tabbarcpntroller控制器上最顶的控制器
 如果self不为uiviewcontrol,返回rootViewcontroller，否则为nil
 */
@property(nonatomic,readonly,strong)LS_CustomTabBarController *LS_tabBarController;
@end

NS_ASSUME_NONNULL_END
